

package com.hazelcast.multimap;

import java.io.Serial;
import java.io.Serializable;

class ComplexValue implements Serializable {

    @Serial
    private static final long serialVersionUID = -6926569333412274188L;

    private final String name;
    private final int time;

    ComplexValue(String name, int time) {
        this.name = name;
        this.time = time;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) {
            return true;
        }
        if (o == null || getClass() != o.getClass()) {
            return false;
        }

        ComplexValue that = (ComplexValue) o;
        if (name != null ? !name.equals(that.name) : that.name != null) {
            return false;
        }
        return true;
    }

    @Override
    public int hashCode() {
        return name != null ? name.hashCode() : 0;
    }

    @Override
    public String toString() {
        return "ComplexValue{" + "name='" + name + '\'' + ", time=" + time + '}';
    }
}
